import React from 'react'

export default class child1 extends React.Component{

    constructor(props){
        super(props)
        this.state={
            money:this.props.money
        }
    }
    // componentDidMount(){
    //     console.log(window.location.href);
    // }
    changeInput=(e)=>{
        this.setState({
            money:e.target.value
        })
    }
    render(){
        return(
            <div>
            <p>我是child2</p>
            <input type="text" value={this.props.money}  onChange={this.props.moneyChange}/>
        </div>
        )
    }
}